<?php /* Template Name: Pricing */ ?>

<?php get_header(); ?>
    
<?php 

    //SETTTINGS
    $result_cmb_kodax_pricing = get_post_meta($post->ID, 'cmb_kodax_pricing', true);

    //SET CONTAINER SIZE CLASS
    $container_size_class = "third price";
    if (isset($result_cmb_kodax_pricing['num'])) {
        
        switch ($result_cmb_kodax_pricing['num']) {
        case 1:
            $container_size_class = "full price";
            break;
        case 2:
            $container_size_class = "half price";
            break;
        case 3:
            $container_size_class = "third price";
            break;
        case 4:
            $container_size_class = "fourth price";
            break;
        case 5:
            $container_size_class = "fifth price";
            break;

        default:
            $container_size_class = "third price";
            break;
        }
            
    }


?>    	
    
    
        <!-- start main-container -->
        <div class="main-container">
            <!-- start main wrapper -->
            <div class="main wrapper clearfix">
                <!-- start main-content -->
                <div class="main-content full">
                    <!-- clearfix -->
                    <div class="clearfix">
        
                        <!-- MAIN LOOP -->
                        <?php while ( have_posts() ) : the_post(); ?>

                            <h1><?php the_title(); ?></h1>
                            <?php the_content(); ?>   	
							
							<br/>
                            <?php 

                                if (isset($result_cmb_kodax_pricing['show_pricing'])) {

                                    echo '<div class="clearfix">';
                                
                                    for ($i = 0; $i < $result_cmb_kodax_pricing['num']; $i++) {  

                                        //SET CONTAINER FEATURE CLASS
                                        $container_feature_class = "";
                                        if (isset($result_cmb_kodax_pricing['tables'][$i]['feature'])) { $container_feature_class = " price-feature"; }

                                        //SET CONTAINTER LAST CLASS
                                        $container_last_class = "";
                                        if ($i+1 == $result_cmb_kodax_pricing['num']) { $container_last_class = " last"; }

                                        //SET FINAL CONTAINER CLASS
                                        $container_class = $container_size_class . $container_feature_class . $container_last_class;

                                        ?>

                                            <!-- Start Price -->
                                            <div class="<?php echo $container_class; ?>">
                                                <h3><?php echo $result_cmb_kodax_pricing['tables'][$i]['title']; ?><span><?php echo $result_cmb_kodax_pricing['tables'][$i]['price']; ?> <span><?php echo $result_cmb_kodax_pricing['tables'][$i]['interval']; ?></span></span></h3>
                                                <div class="price-detail">
                                                
                                                <?php echo do_shortcode($result_cmb_kodax_pricing['tables'][$i]['description']); ?>

                                                <a class="btn active" href="<?php echo $result_cmb_kodax_pricing['tables'][$i]['button_link']; ?>"><?php echo $result_cmb_kodax_pricing['tables'][$i]['button_text']; ?></a>
                                                </div>  
                                            </div>

                                        <?php


                                    }

                                    echo '</div>';

                                }

                            ?>                



                            <?php 

                                if (isset($result_cmb_kodax_pricing['show_faq'])) {
                                ?>
                                    <hr/>
                                    <!-- Start FAQ -->
                                    <div class="clearfix">

                                        <h3><?php echo $result_cmb_kodax_pricing['faq_section_title']; ?></h3>

                                        <?php echo do_shortcode($result_cmb_kodax_pricing['faq']); ?>

                                    </div>
                                        
                                <?php    
                                }

                            ?>
        	                		
                        <?php endwhile; ?>
                        <!-- END LOOP -->
        
                    </div>
                    <!-- end clearfix -->    
                </div>
                <!-- end main-content -->              
            </div>
            <!-- end main wrapper -->
        </div> 
        <!-- end main-container -->
  
        
    	
    	
<?php get_footer(); ?>